{
 "cells": [
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T02:54:50.954382Z",
     "start_time": "2025-02-21T02:54:49.094760Z"
    }
   },
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from sklearn.decomposition import PCA\n",
    "from sklearn.cluster import KMeans\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.metrics import silhouette_score"
   ],
   "outputs": [],
   "execution_count": 1
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:05:32.901314Z",
     "start_time": "2025-02-21T03:05:27.642423Z"
    }
   },
   "source": [
    "# 读取四张表的数据\n",
    "#读取了订单和产品id的关联，csv比较大\n",
    "prior = pd.read_csv(\"./data/instacart/order_products__prior.csv\")"
   ],
   "outputs": [],
   "execution_count": 2
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:05:55.223992Z",
     "start_time": "2025-02-21T03:05:55.163487Z"
    }
   },
   "source": [
    "#产品id，与过道的对应\n",
    "products = pd.read_csv(\"./data/instacart/products.csv\")"
   ],
   "outputs": [],
   "execution_count": 3
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:06:30.548666Z",
     "start_time": "2025-02-21T03:06:29.418002Z"
    }
   },
   "source": [
    "#订单id和用户id的对应，csv比较大\n",
    "orders = pd.read_csv(\"./data/instacart/orders.csv\")"
   ],
   "outputs": [],
   "execution_count": 4
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:06:43.742015Z",
     "start_time": "2025-02-21T03:06:43.713461Z"
    }
   },
   "source": [
    "#超市的过道，过道放的产品的品类\n",
    "aisles = pd.read_csv(\"./data/instacart/aisles.csv\")"
   ],
   "outputs": [],
   "execution_count": 5
  },
  {
   "cell_type": "code",
   "source": [
    "prior.head()  #订单id，产品id，下面只需要掌握订单和产品的关联即可"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:09:13.089005Z",
     "start_time": "2025-02-21T03:09:13.081003Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   order_id  product_id  add_to_cart_order  reordered\n",
       "0         2       33120                  1          1\n",
       "1         2       28985                  2          1\n",
       "2         2        9327                  3          0\n",
       "3         2       45918                  4          1\n",
       "4         2       30035                  5          0"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>product_id</th>\n",
       "      <th>add_to_cart_order</th>\n",
       "      <th>reordered</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>33120</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>28985</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>9327</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2</td>\n",
       "      <td>45918</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>30035</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 6
  },
  {
   "cell_type": "code",
   "source": [
    "products.head() #产品id，产品名称，过道id"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:09:14.680483Z",
     "start_time": "2025-02-21T03:09:14.674567Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   product_id                                       product_name  aisle_id  \\\n",
       "0           1                         Chocolate Sandwich Cookies        61   \n",
       "1           2                                   All-Seasons Salt       104   \n",
       "2           3               Robust Golden Unsweetened Oolong Tea        94   \n",
       "3           4  Smart Ones Classic Favorites Mini Rigatoni Wit...        38   \n",
       "4           5                          Green Chile Anytime Sauce         5   \n",
       "\n",
       "   department_id  \n",
       "0             19  \n",
       "1             13  \n",
       "2              7  \n",
       "3              1  \n",
       "4             13  "
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>product_id</th>\n",
       "      <th>product_name</th>\n",
       "      <th>aisle_id</th>\n",
       "      <th>department_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>Chocolate Sandwich Cookies</td>\n",
       "      <td>61</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>All-Seasons Salt</td>\n",
       "      <td>104</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>Robust Golden Unsweetened Oolong Tea</td>\n",
       "      <td>94</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>Smart Ones Classic Favorites Mini Rigatoni Wit...</td>\n",
       "      <td>38</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>Green Chile Anytime Sauce</td>\n",
       "      <td>5</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 7
  },
  {
   "cell_type": "code",
   "source": [
    "orders.head() #订单id，用户id"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:09:16.914788Z",
     "start_time": "2025-02-21T03:09:16.908407Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   order_id  user_id eval_set  order_number  order_dow  order_hour_of_day  \\\n",
       "0   2539329        1    prior             1          2                  8   \n",
       "1   2398795        1    prior             2          3                  7   \n",
       "2    473747        1    prior             3          3                 12   \n",
       "3   2254736        1    prior             4          4                  7   \n",
       "4    431534        1    prior             5          4                 15   \n",
       "\n",
       "   days_since_prior_order  \n",
       "0                     NaN  \n",
       "1                    15.0  \n",
       "2                    21.0  \n",
       "3                    29.0  \n",
       "4                    28.0  "
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>user_id</th>\n",
       "      <th>eval_set</th>\n",
       "      <th>order_number</th>\n",
       "      <th>order_dow</th>\n",
       "      <th>order_hour_of_day</th>\n",
       "      <th>days_since_prior_order</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2539329</td>\n",
       "      <td>1</td>\n",
       "      <td>prior</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>8</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2398795</td>\n",
       "      <td>1</td>\n",
       "      <td>prior</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>473747</td>\n",
       "      <td>1</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>12</td>\n",
       "      <td>21.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2254736</td>\n",
       "      <td>1</td>\n",
       "      <td>prior</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>29.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>431534</td>\n",
       "      <td>1</td>\n",
       "      <td>prior</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>15</td>\n",
       "      <td>28.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 8
  },
  {
   "cell_type": "code",
   "source": [
    "aisles.head() #过道id，对应过道里放了哪些产品类别"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:09:18.049606Z",
     "start_time": "2025-02-21T03:09:18.043605Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   aisle_id                       aisle\n",
       "0         1       prepared soups salads\n",
       "1         2           specialty cheeses\n",
       "2         3         energy granola bars\n",
       "3         4               instant foods\n",
       "4         5  marinades meat preparation"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>aisle_id</th>\n",
       "      <th>aisle</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>prepared soups salads</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>specialty cheeses</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>energy granola bars</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>instant foods</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>marinades meat preparation</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 9
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:09:43.004078Z",
     "start_time": "2025-02-21T03:09:25.893126Z"
    }
   },
   "source": [
    "_ = pd.merge(prior, products, on=['product_id', 'product_id'])\n",
    "_mg = pd.merge(_, orders, on=['order_id', 'order_id'])\n",
    "mt = pd.merge(_mg, aisles, on=['aisle_id', 'aisle_id'])"
   ],
   "outputs": [],
   "execution_count": 10
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:10:06.685090Z",
     "start_time": "2025-02-21T03:10:06.676973Z"
    }
   },
   "source": [
    "mt.head(10)"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   order_id  product_id  add_to_cart_order  reordered  \\\n",
       "0         2       33120                  1          1   \n",
       "1         2       28985                  2          1   \n",
       "2         2        9327                  3          0   \n",
       "3         2       45918                  4          1   \n",
       "4         2       30035                  5          0   \n",
       "5         2       17794                  6          1   \n",
       "6         2       40141                  7          1   \n",
       "7         2        1819                  8          1   \n",
       "8         2       43668                  9          0   \n",
       "9         3       33754                  1          1   \n",
       "\n",
       "                                        product_name  aisle_id  department_id  \\\n",
       "0                                 Organic Egg Whites        86             16   \n",
       "1                              Michigan Organic Kale        83              4   \n",
       "2                                      Garlic Powder       104             13   \n",
       "3                                     Coconut Butter        19             13   \n",
       "4                                  Natural Sweetener        17             13   \n",
       "5                                            Carrots        83              4   \n",
       "6                   Original Unflavored Gelatine Mix       105             13   \n",
       "7           All Natural No Stir Creamy Almond Butter        88             13   \n",
       "8                            Classic Blend Cole Slaw       123              4   \n",
       "9  Total 2% with Strawberry Lowfat Greek Strained...       120             16   \n",
       "\n",
       "   user_id eval_set  order_number  order_dow  order_hour_of_day  \\\n",
       "0   202279    prior             3          5                  9   \n",
       "1   202279    prior             3          5                  9   \n",
       "2   202279    prior             3          5                  9   \n",
       "3   202279    prior             3          5                  9   \n",
       "4   202279    prior             3          5                  9   \n",
       "5   202279    prior             3          5                  9   \n",
       "6   202279    prior             3          5                  9   \n",
       "7   202279    prior             3          5                  9   \n",
       "8   202279    prior             3          5                  9   \n",
       "9   205970    prior            16          5                 17   \n",
       "\n",
       "   days_since_prior_order                       aisle  \n",
       "0                     8.0                        eggs  \n",
       "1                     8.0            fresh vegetables  \n",
       "2                     8.0           spices seasonings  \n",
       "3                     8.0               oils vinegars  \n",
       "4                     8.0          baking ingredients  \n",
       "5                     8.0            fresh vegetables  \n",
       "6                     8.0  doughs gelatins bake mixes  \n",
       "7                     8.0                     spreads  \n",
       "8                     8.0  packaged vegetables fruits  \n",
       "9                    12.0                      yogurt  "
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>order_id</th>\n",
       "      <th>product_id</th>\n",
       "      <th>add_to_cart_order</th>\n",
       "      <th>reordered</th>\n",
       "      <th>product_name</th>\n",
       "      <th>aisle_id</th>\n",
       "      <th>department_id</th>\n",
       "      <th>user_id</th>\n",
       "      <th>eval_set</th>\n",
       "      <th>order_number</th>\n",
       "      <th>order_dow</th>\n",
       "      <th>order_hour_of_day</th>\n",
       "      <th>days_since_prior_order</th>\n",
       "      <th>aisle</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>33120</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Organic Egg Whites</td>\n",
       "      <td>86</td>\n",
       "      <td>16</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>eggs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>28985</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>Michigan Organic Kale</td>\n",
       "      <td>83</td>\n",
       "      <td>4</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>fresh vegetables</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>9327</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>Garlic Powder</td>\n",
       "      <td>104</td>\n",
       "      <td>13</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>spices seasonings</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2</td>\n",
       "      <td>45918</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>Coconut Butter</td>\n",
       "      <td>19</td>\n",
       "      <td>13</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>oils vinegars</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>30035</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>Natural Sweetener</td>\n",
       "      <td>17</td>\n",
       "      <td>13</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>baking ingredients</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2</td>\n",
       "      <td>17794</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>Carrots</td>\n",
       "      <td>83</td>\n",
       "      <td>4</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>fresh vegetables</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>40141</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>Original Unflavored Gelatine Mix</td>\n",
       "      <td>105</td>\n",
       "      <td>13</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>doughs gelatins bake mixes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2</td>\n",
       "      <td>1819</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>All Natural No Stir Creamy Almond Butter</td>\n",
       "      <td>88</td>\n",
       "      <td>13</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>spreads</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2</td>\n",
       "      <td>43668</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>Classic Blend Cole Slaw</td>\n",
       "      <td>123</td>\n",
       "      <td>4</td>\n",
       "      <td>202279</td>\n",
       "      <td>prior</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>packaged vegetables fruits</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3</td>\n",
       "      <td>33754</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Total 2% with Strawberry Lowfat Greek Strained...</td>\n",
       "      <td>120</td>\n",
       "      <td>16</td>\n",
       "      <td>205970</td>\n",
       "      <td>prior</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>17</td>\n",
       "      <td>12.0</td>\n",
       "      <td>yogurt</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 11
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:11:39.158886Z",
     "start_time": "2025-02-21T03:11:39.154335Z"
    }
   },
   "source": [
    "mt.shape"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(32434489, 14)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 12
  },
  {
   "cell_type": "code",
   "source": "mt.isnull().sum()/mt.shape[0] ",
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-02-21T03:12:09.381257Z",
     "start_time": "2025-02-21T03:12:06.945539Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "order_id                  0.00000\n",
       "product_id                0.00000\n",
       "add_to_cart_order         0.00000\n",
       "reordered                 0.00000\n",
       "product_name              0.00000\n",
       "aisle_id                  0.00000\n",
       "department_id             0.00000\n",
       "user_id                   0.00000\n",
       "eval_set                  0.00000\n",
       "order_number              0.00000\n",
       "order_dow                 0.00000\n",
       "order_hour_of_day         0.00000\n",
       "days_since_prior_order    0.06407\n",
       "aisle                     0.00000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 13
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:13:02.925764Z",
     "start_time": "2025-02-21T03:12:15.297309Z"
    }
   },
   "source": "cross = pd.crosstab(mt['user_id'], mt['aisle'])",
   "outputs": [],
   "execution_count": 14
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:14:20.730102Z",
     "start_time": "2025-02-21T03:14:20.719815Z"
    }
   },
   "source": [
    "cross.head(10)"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "aisle    air fresheners candles  asian foods  baby accessories  \\\n",
       "user_id                                                          \n",
       "1                             0            0                 0   \n",
       "2                             0            3                 0   \n",
       "3                             0            0                 0   \n",
       "4                             0            0                 0   \n",
       "5                             0            2                 0   \n",
       "6                             0            0                 0   \n",
       "7                             0            0                 0   \n",
       "8                             0            1                 0   \n",
       "9                             0            0                 0   \n",
       "10                            0            1                 0   \n",
       "\n",
       "aisle    baby bath body care  baby food formula  bakery desserts  \\\n",
       "user_id                                                            \n",
       "1                          0                  0                0   \n",
       "2                          0                  0                0   \n",
       "3                          0                  0                0   \n",
       "4                          0                  0                0   \n",
       "5                          0                  0                0   \n",
       "6                          0                  0                0   \n",
       "7                          0                  0                0   \n",
       "8                          0                  0                0   \n",
       "9                          0                  6                0   \n",
       "10                         0                  0                0   \n",
       "\n",
       "aisle    baking ingredients  baking supplies decor  beauty  beers coolers  \\\n",
       "user_id                                                                     \n",
       "1                         0                      0       0              0   \n",
       "2                         2                      0       0              0   \n",
       "3                         0                      0       0              0   \n",
       "4                         0                      0       0              0   \n",
       "5                         0                      0       0              0   \n",
       "6                         0                      0       0              0   \n",
       "7                         2                      0       0              0   \n",
       "8                         1                      0       0              0   \n",
       "9                         2                      0       0              0   \n",
       "10                        0                      0       0              0   \n",
       "\n",
       "aisle    ...  spreads  tea  tofu meat alternatives  tortillas flat bread  \\\n",
       "user_id  ...                                                               \n",
       "1        ...        1    0                       0                     0   \n",
       "2        ...        3    1                       1                     0   \n",
       "3        ...        4    1                       0                     0   \n",
       "4        ...        0    0                       0                     1   \n",
       "5        ...        0    0                       0                     0   \n",
       "6        ...        0    0                       0                     0   \n",
       "7        ...        0    0                       0                     0   \n",
       "8        ...        0    0                       0                     0   \n",
       "9        ...        0    0                       0                     0   \n",
       "10       ...        0    0                       0                     0   \n",
       "\n",
       "aisle    trail mix snack mix  trash bags liners  vitamins supplements  \\\n",
       "user_id                                                                 \n",
       "1                          0                  0                     0   \n",
       "2                          0                  0                     0   \n",
       "3                          0                  0                     0   \n",
       "4                          0                  0                     0   \n",
       "5                          0                  0                     0   \n",
       "6                          0                  0                     0   \n",
       "7                          0                  0                     0   \n",
       "8                          0                  0                     0   \n",
       "9                          0                  0                     0   \n",
       "10                         0                  0                     0   \n",
       "\n",
       "aisle    water seltzer sparkling water  white wines  yogurt  \n",
       "user_id                                                      \n",
       "1                                    0            0       1  \n",
       "2                                    2            0      42  \n",
       "3                                    2            0       0  \n",
       "4                                    1            0       0  \n",
       "5                                    0            0       3  \n",
       "6                                    0            0       0  \n",
       "7                                    0            0       5  \n",
       "8                                    0            0       0  \n",
       "9                                    2            0      19  \n",
       "10                                   0            0       2  \n",
       "\n",
       "[10 rows x 134 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>aisle</th>\n",
       "      <th>air fresheners candles</th>\n",
       "      <th>asian foods</th>\n",
       "      <th>baby accessories</th>\n",
       "      <th>baby bath body care</th>\n",
       "      <th>baby food formula</th>\n",
       "      <th>bakery desserts</th>\n",
       "      <th>baking ingredients</th>\n",
       "      <th>baking supplies decor</th>\n",
       "      <th>beauty</th>\n",
       "      <th>beers coolers</th>\n",
       "      <th>...</th>\n",
       "      <th>spreads</th>\n",
       "      <th>tea</th>\n",
       "      <th>tofu meat alternatives</th>\n",
       "      <th>tortillas flat bread</th>\n",
       "      <th>trail mix snack mix</th>\n",
       "      <th>trash bags liners</th>\n",
       "      <th>vitamins supplements</th>\n",
       "      <th>water seltzer sparkling water</th>\n",
       "      <th>white wines</th>\n",
       "      <th>yogurt</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>user_id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 134 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 15
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:14:21.975634Z",
     "start_time": "2025-02-21T03:14:21.971601Z"
    }
   },
   "source": "cross.shape",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(206209, 134)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 16
  },
  {
   "cell_type": "code",
   "source": [
    "type(cross)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:14:25.576969Z",
     "start_time": "2025-02-21T03:14:25.572968Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 17
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:16:06.867688Z",
     "start_time": "2025-02-21T03:16:06.864172Z"
    }
   },
   "source": "pca = PCA(n_components=0.9)",
   "outputs": [],
   "execution_count": 18
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:16:11.997790Z",
     "start_time": "2025-02-21T03:16:11.767737Z"
    }
   },
   "source": [
    "data = pca.fit_transform(cross) \n",
    "data.shape"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(206209, 27)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 19
  },
  {
   "cell_type": "code",
   "source": [
    "type(data)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:16:14.533885Z",
     "start_time": "2025-02-21T03:16:14.530885Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.ndarray"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 20
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:16:18.961606Z",
     "start_time": "2025-02-21T03:16:18.957585Z"
    }
   },
   "source": [
    "x = data[:500]\n",
    "x.shape"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(500, 27)"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 21
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:16:25.002170Z",
     "start_time": "2025-02-21T03:16:24.996735Z"
    }
   },
   "source": [
    "x[0:10]"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-2.42156587e+01, -2.42942720e+00, -2.46636975e+00,\n",
       "         1.45686388e-01,  2.69042476e-01, -1.43293209e+00,\n",
       "        -2.14067666e+00,  2.73803122e+00, -2.71431623e+00,\n",
       "        -1.74313529e+00, -1.13632718e+00,  6.73601069e-01,\n",
       "        -1.65070735e+00,  2.83802486e+00,  5.89384489e+00,\n",
       "        -7.84312891e+00, -4.84010146e+00, -3.22598697e+00,\n",
       "        -4.58007571e+00,  7.77403349e-01, -3.69912893e+00,\n",
       "         1.90721439e+00, -2.99538594e+00, -7.72922878e-01,\n",
       "         6.86800336e-01,  1.69439402e+00, -2.34323022e+00],\n",
       "       [ 6.46320806e+00, -3.67511165e+01,  8.38255336e+00,\n",
       "        -1.50975303e+01, -6.92093785e+00, -9.78375183e-01,\n",
       "        -6.01156653e+00, -3.78772465e+00, -8.18074883e+00,\n",
       "        -9.04086141e+00, -5.61352902e+00, -1.11325323e+00,\n",
       "         2.96702911e+00, -4.73123497e+00, -9.11472283e+00,\n",
       "        -2.14709471e-01,  1.29694031e+00, -7.37605505e-01,\n",
       "        -7.37401979e-01,  7.40042249e-01, -9.13382968e-02,\n",
       "         5.15128465e+00,  4.58481528e+00,  3.23789431e+00,\n",
       "         4.12121252e+00,  2.44689740e+00, -4.28348478e+00],\n",
       "       [-7.99030162e+00, -2.40438257e+00, -1.10300641e+01,\n",
       "        -6.72230096e-01, -4.42368029e-01, -2.82327194e+00,\n",
       "         6.28414012e+00, -6.51250946e+00, -2.14863353e+00,\n",
       "        -1.58525733e+00,  8.28813958e+00, -2.66151647e+00,\n",
       "        -4.50773836e+00,  1.19764737e+00,  6.93186953e-01,\n",
       "        -2.03281164e+00, -2.15050796e+00,  5.43473349e+00,\n",
       "        -3.60484175e+00,  4.28279419e+00, -4.45833616e-01,\n",
       "         3.03933749e+00,  1.46956568e+00,  2.94665603e+00,\n",
       "         1.77534453e+00, -4.44194030e-01,  7.86665571e-01],\n",
       "       [-2.79911291e+01,  7.55822760e-01, -1.92173207e+00,\n",
       "        -2.09188771e+00, -2.88231934e-01,  9.26177341e-01,\n",
       "        -8.27127057e-01, -6.14848545e-01,  3.78198802e-02,\n",
       "        -8.90672448e-01, -3.72088202e-01, -9.85771637e-01,\n",
       "         1.22495060e+00, -1.09639889e+00, -1.87159972e+00,\n",
       "        -7.10463022e-01,  6.75146395e-01, -2.62095591e-01,\n",
       "        -7.10689458e-02, -2.28812201e-01, -6.06522210e-01,\n",
       "         3.67203966e-01, -9.98709579e-01,  1.77374812e-01,\n",
       "         7.54646031e-01,  1.35817221e-01, -5.00043313e-01],\n",
       "       [-1.98963936e+01,  2.63722464e+00,  5.33228944e-01,\n",
       "        -3.67922837e+00,  6.12824980e-01, -1.62400824e+00,\n",
       "         3.93577123e+00, -2.00462740e+00,  1.00208961e+00,\n",
       "         3.08574683e+00, -5.50145774e-01,  2.87433706e-01,\n",
       "         4.11277359e-01, -2.64715919e+00,  6.28331685e-02,\n",
       "         1.65193116e-01, -4.81514320e-01,  1.64452919e+00,\n",
       "        -4.03108796e-01,  1.36899942e-01, -2.57981162e-01,\n",
       "         2.05400491e-01, -2.83754054e-01, -3.83840932e-01,\n",
       "        -1.93524072e-01, -6.45446295e-03, -2.08896003e-01],\n",
       "       [-2.64697723e+01,  4.68042570e+00,  4.64557305e-01,\n",
       "        -2.91452624e+00,  2.76753747e-01,  4.50849758e-01,\n",
       "         6.17645819e-01, -1.36215062e+00, -8.78502640e-02,\n",
       "         1.04054593e+00, -1.29224191e-02, -7.72674027e-01,\n",
       "        -1.05021630e+00, -3.84457799e-01, -6.50245651e-01,\n",
       "        -6.13803784e-01, -3.15793193e-01,  4.45930153e-01,\n",
       "        -3.11288889e-01,  2.86938163e-01, -1.07310998e-01,\n",
       "         6.65099620e-02, -1.56723355e-01, -1.59418792e-01,\n",
       "        -8.45564389e-02, -3.76327213e-01, -1.50797713e-01],\n",
       "       [ 6.43209799e+00, -5.20763684e+00, -5.37622059e+00,\n",
       "         5.03559798e+00, -1.55767996e+00, -7.73522520e+00,\n",
       "        -3.65929977e+00, -1.36194664e+01,  1.99127136e+01,\n",
       "        -3.87327108e+00,  2.10011278e+00, -2.67040732e+00,\n",
       "        -3.92512694e+00,  2.84756844e+00, -2.99126238e+00,\n",
       "        -4.13848691e+00,  4.59204143e+00,  2.66185949e+00,\n",
       "        -3.19197384e+00,  1.21530631e+00, -1.45136887e+00,\n",
       "         2.61171430e+00,  5.35780919e+00, -1.67350589e-01,\n",
       "         3.68044142e+00,  5.13104043e+00, -2.44269167e+00],\n",
       "       [-1.47587512e+01,  1.48684622e+01,  5.26133999e+00,\n",
       "        -2.72312827e+00, -4.41192804e-01,  1.77040069e+00,\n",
       "        -1.74849912e+00,  3.44199907e-01, -4.91075999e-01,\n",
       "         7.21488180e-01, -2.07273731e-01, -8.11480837e-01,\n",
       "        -1.49222116e+00,  6.44199120e-01, -7.40158282e-01,\n",
       "        -1.66319300e+00, -7.31046033e-01,  1.27234895e+00,\n",
       "        -7.04458786e-01, -1.38317595e-01,  4.33882990e-01,\n",
       "        -1.18706848e+00,  3.63571463e-01, -3.12302788e-01,\n",
       "         1.08780259e+00, -7.86800582e-01, -1.10628088e+00],\n",
       "       [-1.96448729e+01, -1.26189013e+01,  9.83832433e+00,\n",
       "        -5.96574917e+00,  3.25687125e+00,  2.32791585e+00,\n",
       "        -6.73245565e-03, -3.08230596e+00, -2.02937972e+00,\n",
       "        -2.19119257e+00, -5.76293826e-01,  2.98996645e+00,\n",
       "        -2.47415700e+00, -2.88953834e+00, -3.31359457e-01,\n",
       "        -1.21583350e-01,  1.46034805e+00, -1.54383264e+00,\n",
       "        -2.46265921e+00, -9.20833430e-01, -2.09191478e+00,\n",
       "         6.57037453e-02, -1.15878119e+00, -4.98714845e-01,\n",
       "         6.28224832e-01, -8.20937502e-01, -1.02610380e+00],\n",
       "       [ 4.06313864e+00,  1.54398182e+01,  2.77360399e+00,\n",
       "        -1.84179405e+00,  7.00877536e-01, -3.93387952e+00,\n",
       "         3.89695552e+00, -9.00116964e-01, -2.15791311e+00,\n",
       "         6.78592732e-01, -7.31465145e+00, -3.25791681e+00,\n",
       "        -4.73315648e+00,  1.19352292e+00, -1.62849209e+00,\n",
       "        -3.81328812e+00, -1.68239105e+00,  2.85570315e+00,\n",
       "        -8.93176379e-01, -2.53824756e+00, -1.41322471e-01,\n",
       "         4.26790007e-01,  4.48191235e+00, -3.74732433e+00,\n",
       "        -1.03797787e+00, -9.22191838e-01, -7.55201486e+00]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 22
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:16:38.755635Z",
     "start_time": "2025-02-21T03:16:38.751346Z"
    }
   },
   "source": [
    "x.max()"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(407.1856341824979)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 23
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:16:39.808676Z",
     "start_time": "2025-02-21T03:16:39.805291Z"
    }
   },
   "source": [
    "x.min()"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(-144.56766126863667)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 24
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:17:51.450772Z",
     "start_time": "2025-02-21T03:17:51.447662Z"
    }
   },
   "source": "km = KMeans(n_clusters=4)",
   "outputs": [],
   "execution_count": 25
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:18:06.094077Z",
     "start_time": "2025-02-21T03:18:05.930410Z"
    }
   },
   "source": "km.fit(x) ",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "KMeans(n_clusters=4)"
      ],
      "text/html": [
       "<style>#sk-container-id-1 {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, white)));\n",
       "  --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, black)));\n",
       "  --sklearn-color-icon: #696969;\n",
       "\n",
       "  @media (prefers-color-scheme: dark) {\n",
       "    /* Redefinition of color scheme for dark theme */\n",
       "    --sklearn-color-text-on-default-background: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-background: var(--sg-background-color, var(--theme-background, var(--jp-layout-color0, #111)));\n",
       "    --sklearn-color-border-box: var(--sg-text-color, var(--theme-code-foreground, var(--jp-content-font-color1, white)));\n",
       "    --sklearn-color-icon: #878787;\n",
       "  }\n",
       "}\n",
       "\n",
       "#sk-container-id-1 {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip: rect(1px 1px 1px 1px);\n",
       "  clip: rect(1px, 1px, 1px, 1px);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       "#sk-container-id-1 div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       "#sk-container-id-1 label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: start;\n",
       "  justify-content: space-between;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content {\n",
       "  max-height: 0;\n",
       "  max-width: 0;\n",
       "  overflow: hidden;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  max-height: 200px;\n",
       "  max-width: 100%;\n",
       "  overflow: auto;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       "#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       "#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-label label.sk-toggleable__label,\n",
       "#sk-container-id-1 div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       "#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       "#sk-container-id-1 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       "#sk-container-id-1 div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  display: inline-block;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       "#sk-container-id-1 div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       "#sk-container-id-1 div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "#sk-container-id-1 div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       "#sk-container-id-1 a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "#sk-container-id-1 a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "#sk-container-id-1 a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>KMeans(n_clusters=4)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>KMeans</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.cluster.KMeans.html\">?<span>Documentation for KMeans</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>KMeans(n_clusters=4)</pre></div> </div></div></div></div>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 26
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:18:13.817408Z",
     "start_time": "2025-02-21T03:18:13.813121Z"
    }
   },
   "source": "predict = km.predict(x)",
   "outputs": [],
   "execution_count": 27
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:18:16.491800Z",
     "start_time": "2025-02-21T03:18:16.487798Z"
    }
   },
   "source": "print(predict)",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 3 3 3\n",
      " 3 3 3 3 3 3 3 3 3 3 3 3 0 3 3 3 0 3 3 3 3 3 3 3 3 0 3 3 3 3 3 3 3 0 3 3 3\n",
      " 0 3 3 3 3 3 3 3 3 3 3 0 3 3 3 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 3\n",
      " 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 3 0 3 3 3 0 3 3\n",
      " 3 3 3 1 0 3 3 3 3 3 3 3 0 3 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 3 3 3 3 3 3 3 3\n",
      " 3 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 3 3 0 3 3 3 3 1 2 3 3 3 0 3 3 3 3 3 3 3 3\n",
      " 1 3 3 3 0 3 3 3 3 0 0 0 3 0 3 3 3 3 3 3 0 3 3 3 3 0 3 3 3 3 3 3 3 3 3 3 3\n",
      " 3 3 3 3 0 3 3 3 3 3 3 3 3 3 3 3 3 3 0 3 0 0 3 3 3 3 3 3 3 0 1 3 3 3 3 3 3\n",
      " 3 3 3 3 3 3 3 3 3 3 3 3 0 3 3 3 2 3 3 3 3 3 3 3 0 3 1 3 3 3 0 3 3 3 3 3 3\n",
      " 0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n",
      " 3 3 0 3 3 3 3 3 3 3 0 3 3 3 3 3 3 3 3 0 3 3 3 3 3 3 3 0 3 3 3 3 0 3 3 3 3\n",
      " 3 0 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 3 3 3 3 3 3 3 3 3 3 3 2\n",
      " 3 3 3 0 3 3 3 0 3 3 3 3 3 3 3 3 3 0 3 0 0 0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0\n",
      " 3 3 3 3 3 0 3 3 3 3 3 3 3 3 0 3 3 3 3]\n"
     ]
    }
   ],
   "execution_count": 28
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:18:40.816925Z",
     "start_time": "2025-02-21T03:18:40.810741Z"
    }
   },
   "source": [
    "import numpy as np\n",
    "np.unique(predict)"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 3], dtype=int32)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 29
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:18:43.941746Z",
     "start_time": "2025-02-21T03:18:43.924589Z"
    }
   },
   "source": "plt.figure(figsize=(20, 20))",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 2000x2000 with 0 Axes>"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 2000x2000 with 0 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 30
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:18:59.574970Z",
     "start_time": "2025-02-21T03:18:59.462321Z"
    }
   },
   "source": [
    "colored = ['orange', 'green', 'blue', 'purple']\n",
    "colr = [colored[i] for i in predict] \n",
    "plt.scatter(x[:, 1], x[:, 19], color=colr)"
   ],
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x25a3a5031a0>"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ],
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAGdCAYAAAA8F1jjAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAUl5JREFUeJzt3Qd4U9XDBvA36aa7UFpKW/beeyOyKgqKIIqgIrJFUUFF/n7iFhUEBWW4ABVBUUBFQRnK3ntvSqF0UOigdCb5nnNuW5qSpAHa5KZ5f8+Tp829t+m5TZr75kyNwWAwgIiIiEiFtPYuABEREZE5DCpERESkWgwqREREpFoMKkRERKRaDCpERESkWgwqREREpFoMKkRERKRaDCpERESkWq5wcHq9HrGxsfD19YVGo7F3cYiIiMgKYr7ZtLQ0hIWFQavVlt2gIkJKRESEvYtBREREdyAmJgbh4eFlN6iImpT8E/Xz87N3cY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/PxK5DFz9bnYfGGznJm2WmA1NAttBo1GUyKPTURERLD6+s2ZaU1w1bqiS9Uu9i4GERGR02PTDxEREakWgwoRERGpFoMKERERqRaDChEREakWgwoRERGpFoMKERERqRaDChEREakWgwoRERGpFoMKERERqZbDz0ybvwKAmIqXiIiIHEP+dbu4lXwcPqikpaXJrxEREfYuChEREd3BdVys+VNmFyXU6/WIjY2Fr6/vHS0cKBKdCDkxMTEltqihGjnLeTrTufI8yxZnOU9nOleep2UifoiQEhYWBq1WW3ZrVMTJhYeH3/XjiD9uWX4hOdt5OtO58jzLFmc5T2c6V56neZZqUvKxMy0RERGpFoMKERERqZbTBxUPDw+8+eab8mtZ5izn6UznyvMsW5zlPJ3pXHmeJcPhO9MSERFR2eX0NSpERESkXgwqREREpFoMKkRERKRaDCpERESkWk4VVN5//320b98e5cqVQ0BAgMljxOy2RW9LliwxOua///5D8+bNZQ/nmjVrYsGCBXC087xw4QIeeOABeUzFihXxyiuvIDc316HO05SqVave8vx9+OGHRsccPHgQnTp1gqenp5xN8eOPP4aj+eKLL+S5inNo06YNdu7cCUf21ltv3fK81a1bt2B/ZmYmxo4di/Lly8PHxwf9+/dHfHw8HMHGjRvRp08fOfumOK8VK1YY7RfjGSZPnoxKlSrBy8sL3bt3x6lTp4yOuXr1KgYPHiwn0xL/08OGDcP169fhSOf59NNP3/Ic33fffQ53nlOmTEGrVq3kbOjivbNv3744ceKE0THWvF6teQ9W+3l26dLllud09OjRJX6eThVUsrOzMWDAAIwZM8bicfPnz8fly5cLbuIJynfu3Dn5R7/33nuxf/9+vPjiixg+fDj+/vtvOMp56nQ6eQ7iuK1bt2LhwoUyhIg3S0c6T3Peeecdo+fv+eefN5rquWfPnqhSpQr27NmDqVOnyovkl19+CUfx008/Yfz48XI44N69e9GkSRNERUUhISEBjqxBgwZGz9vmzZsL9r300kv4448/sHTpUmzYsEEum9GvXz84gvT0dPkciXBpigjKM2fOxNy5c7Fjxw54e3vL51Nc7PKJi/eRI0ewZs0arFy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243btwoOKa416s178FqP8/Tp08b3nnnHXl+4jkVr9/q1asbOnfuXOLn6VRBRQyPE/9ARW///vtvwVC4pk2byou7t7e3HC45d+5c+Ym1MHG8OM7d3V0+MaLmwpHOUzh//ryhV69eBi8vL3lBEBeKnJwchzrPovbs2WNo06aN/Ofy9PQ01KtXz/DBBx/cktxF2u/YsaO82IuaCHGhcDSzZs2Sb4TiuRE1LNu3bzc4MjH0vVKlSvJ8xHMi7os3wnziov3ss8/KWhYRLB9++GH5pukIxP+Rqf9H8X+a/8n1jTfekAFavCa7detmOHHihNFjJCUlyQu2eG8Sn0aHDh1a8MHDEc5TXNzExUpcpERtg5hGYMSIEbeEa0c4T1PnKG6F3x+teb1a8x6s5vO8cOGCDCVBQUHydVuzZk35wVbUCJb0eWryCkRERESkOpxHhYiIiFSLQYWIiIhUi0GFiIiIVItBhYiIiFSLQYWIiIhUi0GFiIiIVItBhYiIiFSLQYWIiIhUi0GFiIiIVItBhYiIiFSLQYWIiIhUi0GFiIiIoFb/D16doufLiAPrAAAAAElFTkSuQmCC"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "execution_count": 31
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:19:04.641378Z",
     "start_time": "2025-02-21T03:19:04.621873Z"
    }
   },
   "source": "silhouette_score(x, predict)",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(0.6519828361081939)"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 32
  },
  {
   "cell_type": "code",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:20:35.113499Z",
     "start_time": "2025-02-21T03:20:35.102022Z"
    }
   },
   "source": [
    "km = KMeans(n_clusters=3)\n",
    "km.fit(x) \n",
    "predict = km.predict(x)\n",
    "print(silhouette_score(x, predict))\n",
    "predict"
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.5161198544883194\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0,\n",
       "       0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,\n",
       "       0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0,\n",
       "       2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2,\n",
       "       0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       2, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 2,\n",
       "       2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,\n",
       "       0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,\n",
       "       0, 0, 0, 2, 0, 1, 0, 2, 0, 0, 2, 1, 0, 0, 0, 1, 0, 2, 0, 0, 2, 0,\n",
       "       2, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0,\n",
       "       1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1,\n",
       "       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 0, 0, 2, 0, 0,\n",
       "       0, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "       2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0,\n",
       "       0, 2, 0, 1, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,\n",
       "       0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0,\n",
       "       0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 2, 0, 2,\n",
       "       0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0, 0, 2,\n",
       "       0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0,\n",
       "       0, 0, 0, 1, 0, 0, 0, 2, 0, 2, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1,\n",
       "       0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0,\n",
       "       0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0], dtype=int32)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 33
  },
  {
   "cell_type": "code",
   "source": "cross.iloc[0]",
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:20:56.825461Z",
     "start_time": "2025-02-21T03:20:56.819969Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "aisle\n",
       "air fresheners candles           0\n",
       "asian foods                      0\n",
       "baby accessories                 0\n",
       "baby bath body care              0\n",
       "baby food formula                0\n",
       "                                ..\n",
       "trash bags liners                0\n",
       "vitamins supplements             0\n",
       "water seltzer sparkling water    0\n",
       "white wines                      0\n",
       "yogurt                           1\n",
       "Name: 1, Length: 134, dtype: int64"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 34
  },
  {
   "cell_type": "code",
   "source": [
    "predict[26]\n",
    "cross.iloc[26]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:20:57.543053Z",
     "start_time": "2025-02-21T03:20:57.536543Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "aisle\n",
       "air fresheners candles             0\n",
       "asian foods                        4\n",
       "baby accessories                   0\n",
       "baby bath body care                0\n",
       "baby food formula                  0\n",
       "                                ... \n",
       "trash bags liners                  0\n",
       "vitamins supplements               0\n",
       "water seltzer sparkling water     92\n",
       "white wines                        0\n",
       "yogurt                           150\n",
       "Name: 27, Length: 134, dtype: int64"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 35
  },
  {
   "cell_type": "code",
   "source": [
    "km = KMeans(n_clusters=3)\n",
    "km.fit(x) \n",
    "predict = km.predict(x)\n",
    "silhouette_score(x, predict)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    },
    "ExecuteTime": {
     "end_time": "2025-02-21T03:20:58.250148Z",
     "start_time": "2025-02-21T03:20:58.238055Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(0.620039994663595)"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 36
  },
  {
   "cell_type": "code",
   "source": [
    "np.random.seed(42)  \n",
    "X = np.random.rand(50, 1) \n",
    "X"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-02-21T03:20:58.995009Z",
     "start_time": "2025-02-21T03:20:58.990084Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.37454012],\n",
       "       [0.95071431],\n",
       "       [0.73199394],\n",
       "       [0.59865848],\n",
       "       [0.15601864],\n",
       "       [0.15599452],\n",
       "       [0.05808361],\n",
       "       [0.86617615],\n",
       "       [0.60111501],\n",
       "       [0.70807258],\n",
       "       [0.02058449],\n",
       "       [0.96990985],\n",
       "       [0.83244264],\n",
       "       [0.21233911],\n",
       "       [0.18182497],\n",
       "       [0.18340451],\n",
       "       [0.30424224],\n",
       "       [0.52475643],\n",
       "       [0.43194502],\n",
       "       [0.29122914],\n",
       "       [0.61185289],\n",
       "       [0.13949386],\n",
       "       [0.29214465],\n",
       "       [0.36636184],\n",
       "       [0.45606998],\n",
       "       [0.78517596],\n",
       "       [0.19967378],\n",
       "       [0.51423444],\n",
       "       [0.59241457],\n",
       "       [0.04645041],\n",
       "       [0.60754485],\n",
       "       [0.17052412],\n",
       "       [0.06505159],\n",
       "       [0.94888554],\n",
       "       [0.96563203],\n",
       "       [0.80839735],\n",
       "       [0.30461377],\n",
       "       [0.09767211],\n",
       "       [0.68423303],\n",
       "       [0.44015249],\n",
       "       [0.12203823],\n",
       "       [0.49517691],\n",
       "       [0.03438852],\n",
       "       [0.9093204 ],\n",
       "       [0.25877998],\n",
       "       [0.66252228],\n",
       "       [0.31171108],\n",
       "       [0.52006802],\n",
       "       [0.54671028],\n",
       "       [0.18485446]])"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 37
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-02-21T03:21:00.101090Z",
     "start_time": "2025-02-21T03:21:00.096076Z"
    }
   },
   "cell_type": "code",
   "source": "X.shape",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(50, 1)"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 38
  },
  {
   "cell_type": "code",
   "source": [
    "X[0,0]=3\n",
    "X[1,0]=2"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-02-21T03:21:02.523072Z",
     "start_time": "2025-02-21T03:21:02.519552Z"
    }
   },
   "outputs": [],
   "execution_count": 39
  },
  {
   "cell_type": "code",
   "source": [
    "import pandas as pd\n",
    "df=pd.DataFrame(X,columns=['column_name'])\n",
    "Q1 = df['column_name'].quantile(0.25)  # 第一四分位数（25%）\n",
    "Q3 = df['column_name'].quantile(0.75)  # 第三四分位数（75%）\n",
    "IQR = Q3 - Q1\n",
    "lower_bound = Q1 - 1.5 * IQR\n",
    "upper_bound = Q3 + 1.5 * IQR\n",
    "df['outlier'] = df['column_name'].apply(lambda x: 'Yes' if x < lower_bound or x > upper_bound else 'No')\n",
    "df[df['outlier'] == 'Yes']"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-02-21T03:21:03.448109Z",
     "start_time": "2025-02-21T03:21:03.440105Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "   column_name outlier\n",
       "0          3.0     Yes\n",
       "1          2.0     Yes"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>column_name</th>\n",
       "      <th>outlier</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3.0</td>\n",
       "      <td>Yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>Yes</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 40
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
